package com.ljy.retry;

import java.lang.reflect.Method;
import java.util.concurrent.Callable;

import org.springframework.cglib.proxy.MethodProxy;

/** 
* @author James
* @date 2018年8月23日 
*/
public class RetryCallable implements Callable{

	private Object obj;
	private Object[] args;
	private MethodProxy methodProxy;
	
	public void init(Object obj, Object[] args, MethodProxy methodProxy) {
		this.obj = obj;
		this.args = args;
		this.methodProxy = methodProxy;
	}
	
	@Override
	public Object call() {
		try {
			return methodProxy.invokeSuper(obj, args);
		} catch (Throwable e) {
			e.printStackTrace();
		}
		return null;
	}

}
